#include <iostream>
using namespace std;
typedef long long ll;
void solve() {
    ll n, a, b;
    cin >> n >> a >> b;
    if (n <= 2) {
        cout << min(a, b) << endl;
        return;
    }
    ll q1 = 3 * a;
    ll q2 = 2 * b;
    ll sum = 0;
    if (q1 < q2) {
        sum += n / 2 * a;
        n %= 2;
        if (n) {
            sum += min(min(a, b), b - a);
        }
    } else {
        sum += n / 3 * b;
        n %= 3;
        if (n == 1) {
            sum += min(min(a, b), 2 * a - b);
        }
        if (n == 2) {
            sum += min(min(a, b), 3 * a - b);
        }
    }
    cout << sum << endl;
}
int main() {
    int T;
    cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}